package com.caishi.lkx.order.vo;

import cn.hutool.core.bean.BeanUtil;
import com.caishi.lkx.common.ienum.DeviceType;
import com.caishi.lkx.order.ienum.status.PaymentStatus;
import com.caishi.lkx.order.ienum.type.PaymentType;
import com.caishi.lkx.order.model.OrderModel;
import com.caishi.lkx.order.model.PaymentModel;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
public class OrderAndPaymentVo extends OrderModel {

    /**
     * 支付类型
     */
    private PaymentType paymentType;

    /**
     * 支付状态
     */
    private PaymentStatus paymentStatus;

    /**
     * 支付订单
     */
    private String orderId;

    /**
     * 支付金额（分）
     */
    private Long paymentAmount;

    /**
     * 支付单号
     */
    private String paySn;

    /**
     * 支付设备通道
     */
    private DeviceType deviceType;

    /**
     * 支付时间
     */
    private LocalDateTime payTime;

    /**
     * 退款时间
     */
    private LocalDateTime refundTime;

    /**
     * 支付单支付人
     */
    private String payUserId;
    /**
     * sku
     */
    private String skuName;

    /**
     * 考试
     */
    private String examName;

    /**
     * 行业
     */
    private String industryName;

    /**
     * 套餐
     */
    private String packageName;
    /**
     * 原价/分
     */
    private Long skuOriginalPrice;
    /**
     * 折扣价/分
     */
    private Long skuDiscountPrice;
    /**
     * 代理价/分
     */
    private Long skuAgentPrice;
    /**
     * 天猫价/分
     */
    private Long skuTmPrice;


    /**
     * 支付模式 支付宝 微信支付模式 二维码 native
     */
    private String mode;

    public PaymentModel getPaymentModel() {
        if (paymentStatus == null) {
            return null;
        }
        PaymentModel model = new PaymentModel();
        BeanUtil.copyProperties(this, model, "id", "createdTime", "createdBy", "modifyTime", "modifyBy");
        return model;
    }

}
